package com.demo.repository;

import com.demo.entity.Grade;
import com.demo.entity.GradeExample;
import java.util.List;

import com.demo.entity.StudentGrade;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface GradeRepository {
    long countByExample(GradeExample example);

    int deleteByExample(GradeExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Grade record);

    int insertSelective(Grade record);

    List<Grade> selectByExample(GradeExample example);

    Grade selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Grade record, @Param("example") GradeExample example);

    int updateByExample(@Param("record") Grade record, @Param("example") GradeExample example);

    int updateByPrimaryKeySelective(Grade record);

    int updateByPrimaryKey(Grade record);
    @Select("select tb_grade.stu_id,subject_name,grade,season,tb_grade.class_id,stu_name from tb_grade join tb_student on " +
            "tb_grade.stu_id=tb_student.stu_id where subject_name LIKE '%${subjectName}%'")
    List<StudentGrade> SouSuo(String subjectName);


}